<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">











<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Maven Minify Plugin - Basic Configuration</title>
    <style type="text/css" media="all">
      @import url("../css/maven-base.css");
      @import url("../css/maven-theme.css");
      @import url("../css/site.css");
    </style>
    <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" />
          <meta name="author" content="Samuel Santos" />
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
      </head>
  <body class="composite">
    <div id="banner">
                    <span id="bannerLeft">
    
            Maven Minify Plugin
    
            </span>
                    <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="breadcrumbs">
          
  

  
    
  
  
    
            <div class="xleft">
        Last Published: 2010-04-26
                      </div>
            <div class="xright">      
  

  
    
  
  
    
  </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="leftColumn">
      <div id="navcolumn">
           
  

  
    
  
  
    
                   <h5>Overview</h5>
            <ul>
              
    <li class="none">
                    <a href="../index.html">Introduction</a>
          </li>
              
    <li class="none">
                    <a href="../plugin-info.html">Goals</a>
          </li>
              
    <li class="none">
                    <a href="../usage.html">Usage</a>
          </li>
          </ul>
              <h5>Examples</h5>
            <ul>
              
    <li class="none">
              <strong>Basic Configuration</strong>
        </li>
              
    <li class="none">
                    <a href="../examples/binding.html">Binding to a Phase in the Project Build Cycle</a>
          </li>
              
    <li class="none">
                    <a href="../examples/exclude.html">Exclude source files from the WAR package</a>
          </li>
          </ul>
              <h5>Project Documentation</h5>
            <ul>
              
                
              
      
            
      
            
      
            
      
            
      
            
      
            
      
            
      
            
      
            
      
              
        <li class="collapsed">
                    <a href="../project-info.html">Project Information</a>
                </li>
              
                
              
      
            
      
            
      
              
        <li class="collapsed">
                    <a href="../project-reports.html">Project Reports</a>
                </li>
          </ul>
                                           <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
            <img alt="Built by Maven" src="../images/logos/maven-feather.png"></img>
          </a>
                       
  

  
    
  
  
    
        </div>
    </div>
    <div id="bodyColumn">
      <div id="contentBox">
        <div class="section"><h2>Basic Configuration</h2>
<div class="section"><h3>Configuring your <tt>pom.xml</tt></h3>
<p>You can use the following configuration in your <tt>pom.xml</tt> to run the Maven Minify Plugin everytime the project is built.</p>
<div class="source"><pre>&lt;project&gt;
  ...
  &lt;build&gt;
    &lt;plugins&gt;
      ...
      &lt;plugin&gt;
        &lt;groupId&gt;com.samaxes.maven&lt;/groupId&gt;
        &lt;artifactId&gt;maven-minify-plugin&lt;/artifactId&gt;
        &lt;version&gt;1.2-SNAPSHOT&lt;/version&gt;
        &lt;configuration&gt;
          &lt;cssSourceFiles&gt;
            &lt;param&gt;file-1.css&lt;/param&gt;
            ...
            &lt;param&gt;file-n.css&lt;/param&gt;
          &lt;/cssSourceFiles&gt;
          &lt;jsSourceFiles&gt;
            &lt;param&gt;file-1.js&lt;/param&gt;
            ...
            &lt;param&gt;file-n.js&lt;/param&gt;
          &lt;/jsSourceFiles&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
      ...
    &lt;/plugins&gt;
  &lt;/build&gt;
  ...
&lt;/project&gt;</pre>
</div>
</div>
<div class="section"><h3>From the command-line</h3>
<p>Create a package containing the new files:</p>
<div class="source"><pre>mvn minify:minify package</pre>
</div>
</div>
</div>

      </div>
    </div>
    <div class="clear">
      <hr/>
    </div>
    <div id="footer">
      <div class="xright">&#169;  
          2010
    
          samaxes
          
  

  
    
  
  
    
  </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
  </body>
</html>
